package com.superb.mapper;

import com.superb.entity.User;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author anonymous
 * @since 2020-11-08
 */
@Component
@Mapper
public interface UserMapper extends BaseMapper<User> {

    User getUser(int id);

    @Results(
            @Result(column = "last_login",property = "lastLogin")
    )
    @Select("select * from user")
    List<User> getUsers();
}
